package NG::Sys::Cached::Extend;
use strict;
use warnings;
use utf8;

sub configure {
	my $parent = shift;
	my $realclass = shift;

	my $ref = $parent->{app}->reference("extend");
	no strict 'refs';
	for my $sub (@{$ref->get_list({object => $parent->{namespace}})}){
		*{$realclass."::".$sub->{name}} = eval "sub {
			my \$self = shift;
			$sub->{body}
		}";
		if($@){
			die $@;
		}
	}
}

1;
